<template>
	<view class="my-search-container">
		<view class="my-search-box" @click="gotoSearch">
			<uni-icons class="icon" type="search" size="20"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		data() {
			return {
				
			};
		},
		methods:{
			searchBoxHandler() {
			    // 触发外界通过 @click 绑定的 click 事件处理函数
			    this.$emit('gotoSearch')
			},
			//点击搜索框跳转到搜索页
			gotoSearch(){
				console.log("guiao")
				uni.navigateTo({
					url: '/subpkg/search/search'
				})
			}
		},
		
	}
</script>

<style lang="scss">
	.my-search-container{
		background-color: #c00000;
		padding: 0 10px;
		height: 50px;
		display: flex;
		align-items: center;
	}
	
	.my-search-box{
		height: 36px;
		background-color: #fff;
		width: 100%;
		border-radius: 18px;
		display: flex;
		justify-content: center;
		align-items: center;
		
		.icon{
			margin-top: 3px;
			transform: translateX(-15%);
		}
		
		.placeholder{
			// vertical-align: middle;
			font-style: 15px;
			margin-left: 4px;
			transform: translateX(-15%);
		}
	}
</style>